{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">商品分类</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"
                data-auth-restore="{:$auth->check('goods_cate/restore')}" 
                data-auth-destroy="{:$auth->check('goods_cate/destroy')}"
                ></table>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use('yznTable', function() {
    var table = layui.yznTable;

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTable',
        restore_url: '{:url("goods_cate/restore")}',
        destroy_url: '{:url("goods_cate/destroy")}',
        modify_url: "{:url('goods_cate/multi')}",
    };

    table.render({
        init: init,
        toolbar: ['refresh', 'restore', 'destroy'],
        url: '{:url("goods_cate/recyclebin")}',
        cols: [
            [
                { type: 'checkbox', fixed: 'left' },
                { field: 'id', width: 70, title: 'ID' },
                { field: 'delete_time', width: 160, title: '删除时间', search: 'range', templet: yznTable.formatter.datetime},
                { fixed: 'right', width: 140, title: '操作', templet: yznTable.formatter.tool,operat: ['restore','destroy']}
            ]
        ],
        page: {}
    });

    yznTable.bindevent();
});
</script>
{/block}